<?php
$path = realpath("log_admin.txt");

function mreadfile(){
    global $path;
    $file = fopen($path, 'r');
    $row = 0;
    if(!feof($file)){
        $row = fgets($file);
    }
    fclose($file);
    return $row;
}

function mwritefile($log){
    global $path;
    $file = fopen($path, 'w');
    fwrite($file, $log);
    fclose($file);
}

function mwriteLog(){
    global $path;
    $log = mreadFile();
    $log = intval($log)+ 1;
    mwritefile($log);
    return $log;
}
?>

